package com.yeban.base.day03.homework;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/9/27
 */
// 百元买百鸡
public class Test06 {

    public static void main(String[] args) {

        int money = 100;
        int number = 100;
        int c = 0;
        int count = 1;

        // 公鸡数
        for( int i = 0; i <= 20; i++ ) {
            //母鸡数
            for (int j = 0; j <= 33; j++) {
                // 小鸡为c只
                c = number - i - j;
                if((c % 3 == 0) && (money == 5 * i + 3 * j + c/3)) {
                    System.out.println("第" + count++ + "种方式：");
                    System.out.println("公鸡：" + i + "只");
                    System.out.println("母鸡：" + j + "只");
                    System.out.println("小鸡：" + c + "只");
                    System.out.println();
                }
            }
        }
    }
}
